<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
    xmlns:local="clr-namespace:FabTab"
    xmlns:dd="clr-namespace:FabTab.DragDrop"
    xmlns:converters="clr-namespace:FabTab.Converters"
    xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase">

    <dd:FabTabDragDropAdvisor x:Key="advisor"/>
    
    
    <Style x:Key="ImageButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="Height" Value="150"/>
        <Setter Property="Width" Value="200"/>
        <Setter Property="Margin" Value="15,15,15,15"/>
    </Style>

    
        
    <Style x:Key="TabItemFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Rectangle SnapsToDevicePixels="true" Margin="3,3,3,1" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <SolidColorBrush x:Key="TabControlNormalBorderBrush" Color="#8C8E94"/>
    <LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#F3F3F3" Offset="0"/>
        <GradientStop Color="#EBEBEB" Offset="0.5"/>
        <GradientStop Color="#DDDDDD" Offset="0.5"/>
        <GradientStop Color="#CDCDCD" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="TabItemHotBackground" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#EAF6FD" Offset="0.15"/>
        <GradientStop Color="#D9F0FC" Offset=".5"/>
        <GradientStop Color="#BEE6FD" Offset=".5"/>
        <GradientStop Color="#A7D9F5" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="TabItemSelectedBackground" Color="#F9F9F9"/>
    <SolidColorBrush x:Key="TabItemHotBorderBrush" Color="#3C7FB1"/>
    <SolidColorBrush x:Key="TabItemDisabledBackground" Color="#F4F4F4"/>
    <SolidColorBrush x:Key="TabItemDisabledBorderBrush" Color="#FFC9C7BA"/>

    <!--<Style x:Key="CloseButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="FontSize" Value="8"/>
        <Setter Property="Content" Value="X"/>
        <Setter Property="Height" Value="15"/>
        <Setter Property="Width" Value="12"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border Name="customBorder" CornerRadius="2" BorderThickness="1" BorderBrush="Black"
                                Background="LightBlue">
                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="customBorder" Property="Background" 
                                        Value="DarkGray" />
                            <Setter Property="Foreground" Value="White"/>
                            <Setter Property="FontWeight" Value="Bold"/>
                            <Setter Property="BitmapEffect">
                                <Setter.Value>
                                    <OuterGlowBitmapEffect GlowColor="DodgerBlue" GlowSize="4"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>-->
    
    <Style x:Key="CloseButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="FontSize" Value="8"/>
        <Setter Property="Content" Value="X"/>
        <Setter Property="Height" Value="15"/>
        <Setter Property="Width" Value="12"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush" Value="Orange"/>
        <Setter Property="Background" Value="Green"/>
        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border Name="customBorder" CornerRadius="2" BorderThickness="0" BorderBrush="Transparent"
                                Background="Transparent" >
                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="customBorder" Property="Background" Value="LightBlue"/>
                            <Setter TargetName="customBorder" Property="BorderThickness" Value="1"/>
                            <Setter TargetName="customBorder" Property="BorderBrush" Value="Black"/>
                            <Setter Property="FontWeight" Value="Bold"/>
                        </Trigger>
                        <Trigger Property="Button.IsPressed" Value="True">
                            <Setter TargetName="customBorder" Property="Background" 
                                        Value="DarkGray" />
                            <Setter Property="Foreground" Value="White"/>
                            <Setter Property="FontWeight" Value="Bold"/>
                            <Setter Property="BitmapEffect">
                                <Setter.Value>
                                    <OuterGlowBitmapEffect GlowColor="DodgerBlue" GlowSize="4"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    

    <Style TargetType="{x:Type local:FabTabItem}">
        
              
        <Setter Property="FocusVisualStyle" Value="{StaticResource TabItemFocusVisual}"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="Padding" Value="6,1,6,1"/>
        <Setter Property="BorderBrush" Value="{StaticResource TabControlNormalBorderBrush}"/>
        <Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="ShowCloseButton" Value="{Binding Path=ShowTabCloseButtons, RelativeSource={RelativeSource AncestorType={x:Type local:FabTabControl}}}"/>
        <Setter Property="dd:DragDropManager.DragSourceAdvisor" Value="{StaticResource advisor}"/>
        <Setter Property="dd:DragDropManager.DropTargetAdvisor" Value="{StaticResource advisor}"/>
        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:FabTabItem}">
                    <ControlTemplate.Resources>
                        <SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />


                        <Style TargetType="{x:Type ToolTip}" >
                            <Setter Property="OverridesDefaultStyle" Value="true"/>
                            <Setter Property="HasDropShadow" Value="True"/>
                            <Setter Property="Margin" Value="0,0,0,0"/>
                            <Setter Property="Padding" Value="0"/>
                            
                            
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="ToolTip">
                                        <Border Name="Border"
                  Background="LightGray"
                  BorderBrush="{StaticResource SolidBorderBrush}"
                  BorderThickness="2"
                  >
                                                    <ContentPresenter
                    Margin="0,0,0,0" 
                    HorizontalAlignment="Left"
                    VerticalAlignment="Top" />
                                                </Border>
                                                <ControlTemplate.Triggers>
                                                    <Trigger Property="HasDropShadow" Value="true">
                                                        <Setter TargetName="Border" Property="CornerRadius" Value="4"/>
                                                        <Setter TargetName="Border" Property="SnapsToDevicePixels" Value="true"/>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                        
                       

                    </ControlTemplate.Resources>
                    <Grid SnapsToDevicePixels="true">
                        <Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" Padding="{TemplateBinding Padding}">
                            <DockPanel SnapsToDevicePixels="True">

                                <Button Name="PART_closeButton" DockPanel.Dock="Right"
                                        Margin="4,0,0,0"
                                        Style="{Binding Path=CloseButtonStyle, RelativeSource={RelativeSource AncestorType={x:Type local:FabTabControl}}}"/>
                                <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
                                                  HorizontalAlignment="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" 
                                                  x:Name="Content" 
                                                  VerticalAlignment="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" 
                                                  ContentSource="Header" 
                                                  RecognizesAccessKey="True"
                                                  DockPanel.Dock="Left"
                                                  />

                            </DockPanel>

                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" TargetName="Bd" Value="{StaticResource TabItemHotBackground}"/>

                        </Trigger>
                        <Trigger Property="IsSelected" Value="true">
                            <Setter Property="Panel.ZIndex" Value="1"/>
                            <Setter Property="Background" TargetName="Bd" Value="{StaticResource TabItemSelectedBackground}"/>
                           
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="false"/>
                                <Condition Property="IsMouseOver" Value="true"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource TabItemHotBorderBrush}"/>

                        </MultiTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:FabTabControl}},Path=ShowToolTipImages}" Value="True" />
                                <Condition Binding="{Binding RelativeSource={x:Static RelativeSource.Self},Path=IsSelected}" Value="false"/>
                                <Condition Binding="{Binding RelativeSource={x:Static RelativeSource.Self},Path=IsMouseOver}" Value="true"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self},Path=(local:FabTabItemProperties.FabTabItemImage)}"/>
                            
                        </MultiDataTrigger>

                        <Trigger Property="TabStripPlacement" Value="Bottom">
                            <Setter Property="BorderThickness" TargetName="Bd" Value="1,0,1,1"/>
                        </Trigger>
                        <Trigger Property="TabStripPlacement" Value="Left">
                            <Setter Property="BorderThickness" TargetName="Bd" Value="1,1,0,1"/>
                        </Trigger>
                        <Trigger Property="TabStripPlacement" Value="Right">
                            <Setter Property="BorderThickness" TargetName="Bd" Value="0,1,1,1"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="true"/>
                                <Condition Property="TabStripPlacement" Value="Top"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Margin" Value="-2,-2,-2,-1"/>
                            <Setter Property="Margin" TargetName="Content" Value="0,0,0,1"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="true"/>
                                <Condition Property="TabStripPlacement" Value="Bottom"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Margin" Value="-2,-1,-2,-2"/>
                            <Setter Property="Margin" TargetName="Content" Value="0,1,0,0"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="true"/>
                                <Condition Property="TabStripPlacement" Value="Left"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Margin" Value="-2,-2,-1,-2"/>
                            <Setter Property="Margin" TargetName="Content" Value="0,0,1,0"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="true"/>
                                <Condition Property="TabStripPlacement" Value="Right"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Margin" Value="-1,-2,-2,-2"/>
                            <Setter Property="Margin" TargetName="Content" Value="1,0,0,0"/>
                        </MultiTrigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" TargetName="Bd" Value="{StaticResource TabItemDisabledBackground}"/>
                            <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource TabItemDisabledBorderBrush}"/>
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>




    <Style TargetType="{x:Type local:FabTabControl}">
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="Padding" Value="4,4,4,4"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{StaticResource TabControlNormalBorderBrush}"/>
        <Setter Property="Background" Value="#F9F9F9"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="CloseButtonStyle" Value="{StaticResource CloseButtonStyle}"/>
        <Setter Property="ContentTabImageButtonStyle" Value="{StaticResource ImageButtonStyle}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:FabTabControl}">
                    <ControlTemplate.Resources>
                        <!--Begin ComboBox default style-->
                        <Style x:Key="ComboBoxFocusVisual">
                            <Setter Property="Control.Template">
                                <Setter.Value>
                                    <ControlTemplate>
                                        <Rectangle SnapsToDevicePixels="true" Margin="4,4,21,4" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1"/>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                        <LinearGradientBrush x:Key="ComboBoxButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
                            <GradientStop Color="#EBEBEB" Offset="0.985"/>
                            <GradientStop Color="#DDDDDD" Offset="1"/>
                            <GradientStop Color="#CDCDCD" Offset="1"/>
                            <GradientStop Color="#FFADD8E6" Offset="0.345"/>
                        </LinearGradientBrush>
                        <SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
                        <Geometry x:Key="DownArrowGeometry">M0,0 L4,6 L8,0</Geometry>
                        <Style x:Key="ComboBoxReadonlyToggleButton" TargetType="{x:Type ToggleButton}">
                            <Setter Property="OverridesDefaultStyle" Value="true"/>
                            <Setter Property="IsTabStop" Value="false"/>
                            <Setter Property="Focusable" Value="false"/>
                            <Setter Property="ClickMode" Value="Press"/>
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type ToggleButton}">
                                        <Microsoft_Windows_Themes:ButtonChrome 
						SnapsToDevicePixels="true" x:Name="Chrome" 
						Background="{TemplateBinding Background}" 
						BorderBrush="{TemplateBinding BorderBrush}" 
						RenderMouseOver="{TemplateBinding IsMouseOver}" 
						RenderPressed="{TemplateBinding IsPressed}">
                                            <Grid HorizontalAlignment="Center" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
                                                <Path HorizontalAlignment="Center" 
								Margin="0,0,0,0" 
								x:Name="Arrow" 
								VerticalAlignment="Center"
								Stroke="Black" 
								StrokeThickness="1"
								Data="{StaticResource DownArrowGeometry}"/>
                                            </Grid>
                                        </Microsoft_Windows_Themes:ButtonChrome>
                                        <ControlTemplate.Triggers>
                                            <Trigger Property="IsChecked" Value="true">
                                                <Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
                                            </Trigger>
                                            <Trigger Property="IsEnabled" Value="false">
                                                <Setter Property="Fill" TargetName="Arrow" Value="#AFAFAF"/>
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                        <LinearGradientBrush x:Key="TextBoxBorder" EndPoint="0,20" StartPoint="0,0" MappingMode="Absolute">
                            <GradientStop Color="#ABADB3" Offset="0.05"/>
                            <GradientStop Color="#E2E3EA" Offset="0.07"/>
                            <GradientStop Color="#E3E9EF" Offset="1"/>
                        </LinearGradientBrush>
                        <Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
                            <Setter Property="OverridesDefaultStyle" Value="true"/>
                            <Setter Property="AllowDrop" Value="true"/>
                            <Setter Property="MinWidth" Value="0"/>
                            <Setter Property="MinHeight" Value="0"/>
                            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type TextBox}">
                                        <ScrollViewer Focusable="false" Background="Transparent" x:Name="PART_ContentHost" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>

                        </Style>
                        <Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
                            <Setter Property="OverridesDefaultStyle" Value="true"/>
                            <Setter Property="IsTabStop" Value="false"/>
                            <Setter Property="Focusable" Value="false"/>
                            <Setter Property="ClickMode" Value="Press"/>
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type ToggleButton}">
                                        <Microsoft_Windows_Themes:ButtonChrome SnapsToDevicePixels="true" x:Name="Chrome" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" RoundCorners="false">
                                            <Path HorizontalAlignment="Center" Margin="0,1,0,0" x:Name="Arrow" VerticalAlignment="Center" Fill="Black" Data="{StaticResource DownArrowGeometry}"/>
                                        </Microsoft_Windows_Themes:ButtonChrome>
                                        <ControlTemplate.Triggers>
                                            <Trigger Property="IsChecked" Value="true">
                                                <Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
                                            </Trigger>
                                            <Trigger Property="IsEnabled" Value="false">
                                                <Setter Property="Fill" TargetName="Arrow" Value="#AFAFAF"/>
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                        <ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
                            <Grid SnapsToDevicePixels="true" x:Name="Placement">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Popup AllowsTransparency="true" IsOpen="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" x:Name="PART_Popup" Grid.ColumnSpan="2">
                                    <Microsoft_Windows_Themes:SystemDropShadowChrome MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding Path=ActualWidth, ElementName=Placement}" x:Name="Shdw" Color="Transparent">
                                        <Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
                                            <ScrollViewer>
                                                <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained"/>
                                            </ScrollViewer>
                                        </Border>
                                    </Microsoft_Windows_Themes:SystemDropShadowChrome>
                                </Popup>
                                <Microsoft_Windows_Themes:ListBoxChrome x:Name="Border" Grid.ColumnSpan="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" RenderFocused="{TemplateBinding IsKeyboardFocusWithin}" RenderMouseOver="{TemplateBinding IsMouseOver}"/>
                                <TextBox 
				HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
				VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" 
				Margin="{TemplateBinding Padding}" 
				x:Name="PART_EditableTextBox" 
				Style="{StaticResource ComboBoxEditableTextBox}" 
				IsReadOnly="{Binding Path=IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
				/>
                                <ToggleButton Style="{StaticResource ComboBoxToggleButton}" 
				Grid.Column="1" 
				IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsKeyboardFocusWithin" Value="true">
                                    <Setter Property="Foreground" Value="Black"/>
                                </Trigger>
                                <Trigger Property="IsDropDownOpen" Value="true">
                                    <Setter Property="RenderFocused" TargetName="Border" Value="true"/>
                                </Trigger>
                                <Trigger Property="HasItems" Value="false">
                                    <Setter Property="Height" TargetName="DropDownBorder" Value="95"/>
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                                    <Setter Property="Background" Value="#FFF4F4F4"/>
                                </Trigger>
                                <Trigger Property="IsGrouping" Value="true">
                                    <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                                </Trigger>
                                <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
                                    <Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
                                    <Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>

                        <Style x:Key="ComboBoxDefaultStyle" TargetType="{x:Type ComboBox}">
                            <Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}"/>
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
                            <Setter Property="Background" Value="{StaticResource ComboBoxButtonNormalBackground}"/>
                            <Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
                            <Setter Property="BorderThickness" Value="1"/>
                            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
                            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
                            <Setter Property="Padding" Value="0"/>
                            <Setter Property="Margin" Value="3,0,0,0"/>
                            <Setter Property="Height" Value="20"/>
                            <Setter Property="Width" Value="20"/>
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type ComboBox}">
                                        <Grid SnapsToDevicePixels="true" x:Name="MainGrid">
                                            <Grid.ColumnDefinitions>

                                                <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
                                            </Grid.ColumnDefinitions>
                                            <Popup AllowsTransparency="true" IsOpen="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Margin="1" x:Name="PART_Popup" Grid.ColumnSpan="2">
                                                <Microsoft_Windows_Themes:SystemDropShadowChrome MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding Path=ActualWidth, ElementName=MainGrid}" x:Name="Shdw" Color="Transparent">
                                                    <Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
                                                        <ScrollViewer CanContentScroll="true">
                                                            <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained"/>
                                                        </ScrollViewer>
                                                    </Border>
                                                </Microsoft_Windows_Themes:SystemDropShadowChrome>
                                            </Popup>
                                            <ToggleButton Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Style="{StaticResource ComboBoxReadonlyToggleButton}" 
							Grid.ColumnSpan="1" Grid.Column="0" 
							IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
                                            <ContentPresenter Visibility="Hidden"
							IsHitTestVisible="false" 
							SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
							HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
							Margin="{TemplateBinding Padding}" 
							VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
							Content="{TemplateBinding SelectionBoxItem}" 
							ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" 
							ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/>
                                        </Grid>
                                        <ControlTemplate.Triggers>
                                            <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
                                                <Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
                                                <Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
                                            </Trigger>
                                            <Trigger Property="HasItems" Value="false">
                                                <Setter Property="Height" TargetName="DropDownBorder" Value="95"/>
                                            </Trigger>
                                            <Trigger Property="IsEnabled" Value="false">
                                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                                                <Setter Property="Background" Value="#FFF4F4F4"/>
                                            </Trigger>
                                            <Trigger Property="IsGrouping" Value="true">
                                                <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <Trigger Property="IsEditable" Value="true">
                                    <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorder}"/>
                                    <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
                                    <Setter Property="IsTabStop" Value="false"/>
                                    <Setter Property="Padding" Value="3"/>
                                    <Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>

                        <!--End ComboBox default style-->



                    </ControlTemplate.Resources>
                    <Grid ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition x:Name="ColumnDefinition0"/>
                            <ColumnDefinition x:Name="ColumnDefinition1" Width="0"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" x:Name="RowDefinition0"/>
                            <RowDefinition Height="*" x:Name="RowDefinition1"/>
                        </Grid.RowDefinitions>
                        <local:FabTabPanel Margin="2,2,2,0" x:Name="HeaderPanel" Grid.Column="0" Grid.Row="0" IsItemsHost="true" Panel.ZIndex="1" KeyboardNavigation.TabIndex="1"/>
                        <Border x:Name="ContentPanel" Grid.Column="0" Grid.Row="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">

                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>

                                
                                <!--might need some testing here.  We don't want this to affect
                                the size of the screen-->
                                <ContentPresenter Grid.Row="0" Grid.Column="0" 
                                                  Margin="0,0,0,0" 
                                                  ContentSource="HiddenContent"
                                                  x:Name="PART_HiddenContentHost"
                                                  Visibility="Hidden">

                                </ContentPresenter>

                                <ContentPresenter Grid.Row="0" Grid.Column="0" 
                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="{TemplateBinding Padding}" 
                                                  x:Name="PART_SelectedContentHost" 
                                                  ContentSource="SelectedContent"
                                                  OpacityMask="{TemplateBinding ContentOpacityMask}"/>
                                
                                
                            </Grid>
                        </Border>

                    </Grid>
                    <ControlTemplate.Triggers>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding Path=ShowDefaultTransitionAnimation,RelativeSource={x:Static RelativeSource.Self}}" Value="True" />
                                <Condition Binding="{Binding Path=DidSelectionChange,RelativeSource={x:Static RelativeSource.Self}}" Value="True"/>
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard AutoReverse="False">
                                        <local:EasingDoubleAnimation Storyboard.TargetProperty="ContentOpacityMask.Opacity"
                                                   To="1" From="0" Duration="0:0:0.7"
                                                   Equation="CubicEaseInOut"
                                                   />
                                    </Storyboard>
                                </BeginStoryboard>
                            </MultiDataTrigger.EnterActions>
                        </MultiDataTrigger>
                                                
                        <Trigger Property="TabStripPlacement" Value="Bottom">
                            <Setter Property="Grid.Row" TargetName="HeaderPanel" Value="1"/>
                            <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0"/>
                            <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
                            <Setter Property="Height" TargetName="RowDefinition1" Value="Auto"/>
                            <Setter Property="Margin" TargetName="HeaderPanel" Value="2,0,2,2"/>
                        </Trigger>
                        <Trigger Property="TabStripPlacement" Value="Left">
                            <Setter Property="Grid.Row" TargetName="HeaderPanel" Value="0"/>
                            <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0"/>
                            <Setter Property="Grid.Column" TargetName="HeaderPanel" Value="0"/>
                            <Setter Property="Grid.Column" TargetName="ContentPanel" Value="1"/>
                            <Setter Property="Width" TargetName="ColumnDefinition0" Value="Auto"/>
                            <Setter Property="Width" TargetName="ColumnDefinition1" Value="*"/>
                            <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
                            <Setter Property="Height" TargetName="RowDefinition1" Value="0"/>
                            <Setter Property="Margin" TargetName="HeaderPanel" Value="2,2,0,2"/>
                        </Trigger>
                        <Trigger Property="TabStripPlacement" Value="Right">
                            <Setter Property="Grid.Row" TargetName="HeaderPanel" Value="0"/>
                            <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0"/>
                            <Setter Property="Grid.Column" TargetName="HeaderPanel" Value="1"/>
                            <Setter Property="Grid.Column" TargetName="ContentPanel" Value="0"/>
                            <Setter Property="Width" TargetName="ColumnDefinition0" Value="*"/>
                            <Setter Property="Width" TargetName="ColumnDefinition1" Value="Auto"/>
                            <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
                            <Setter Property="Height" TargetName="RowDefinition1" Value="0"/>
                            <Setter Property="Margin" TargetName="HeaderPanel" Value="0,2,2,2"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>



    <Style TargetType="{x:Type local:ContentTabItem}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource TabItemFocusVisual}"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="Padding" Value="6,1,6,1"/>
        <Setter Property="BorderBrush" Value="{StaticResource TabControlNormalBorderBrush}"/>
        <Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <ControlTemplate.Resources>


                    </ControlTemplate.Resources>
                    <Grid SnapsToDevicePixels="true">
                        <Border x:Name="Bd" Background="{TemplateBinding Background}" 
                                BorderBrush="{TemplateBinding BorderBrush}" 
                                BorderThickness="1,1,1,0" 
                                Padding="{TemplateBinding Padding}">
                            <DockPanel>
                                <ComboBox x:Name="PART_tabHeaderComboBox" DockPanel.Dock="Right"
                                           Style="{Binding Path=ContentTabHeaderComboBoxStyle, RelativeSource={RelativeSource AncestorType={x:Type local:FabTabControl}}}"
                                           DisplayMemberPath="Value"/>
                                <ContentPresenter DockPanel.Dock="Left"
                                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" 
                                                  x:Name="Content" 
                                                  VerticalAlignment="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" 
                                                  ContentSource="Header" 
                                                  RecognizesAccessKey="True"/>

                            </DockPanel>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" TargetName="Bd" Value="{StaticResource TabItemHotBackground}"/>
                        </Trigger>

                        <Trigger Property="IsSelected" Value="true">
                            <Setter Property="Panel.ZIndex" Value="1"/>
                            <Setter Property="Background" TargetName="Bd" Value="{StaticResource TabItemSelectedBackground}"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="false"/>
                                <Condition Property="IsMouseOver" Value="true"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource TabItemHotBorderBrush}"/>
                        </MultiTrigger>
                        <Trigger Property="TabStripPlacement" Value="Bottom">
                            <Setter Property="BorderThickness" TargetName="Bd" Value="1,0,1,1"/>
                        </Trigger>
                        <Trigger Property="TabStripPlacement" Value="Left">
                            <Setter Property="BorderThickness" TargetName="Bd" Value="1,1,0,1"/>
                        </Trigger>
                        <Trigger Property="TabStripPlacement" Value="Right">
                            <Setter Property="BorderThickness" TargetName="Bd" Value="0,1,1,1"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="true"/>
                                <Condition Property="TabStripPlacement" Value="Top"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Margin" Value="-2,-2,-2,-1"/>
                            <Setter Property="Margin" TargetName="Content" Value="0,0,0,1"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="true"/>
                                <Condition Property="TabStripPlacement" Value="Bottom"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Margin" Value="-2,-1,-2,-2"/>
                            <Setter Property="Margin" TargetName="Content" Value="0,1,0,0"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="true"/>
                                <Condition Property="TabStripPlacement" Value="Left"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Margin" Value="-2,-2,-1,-2"/>
                            <Setter Property="Margin" TargetName="Content" Value="0,0,1,0"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="true"/>
                                <Condition Property="TabStripPlacement" Value="Right"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Margin" Value="-1,-2,-2,-2"/>
                            <Setter Property="Margin" TargetName="Content" Value="1,0,0,0"/>
                        </MultiTrigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" TargetName="Bd" Value="{StaticResource TabItemDisabledBackground}"/>
                            <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource TabItemDisabledBorderBrush}"/>
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style x:Key="ImageButtonFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Rectangle SnapsToDevicePixels="true" Margin="2" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <LinearGradientBrush x:Key="ImageButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#F3F3F3" Offset="0"/>
        <GradientStop Color="#EBEBEB" Offset="0.5"/>
        <GradientStop Color="#DDDDDD" Offset="0.5"/>
        <GradientStop Color="#CDCDCD" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="ImageButtonNormalBorder" Color="#FF707070"/>

    <Style TargetType="{x:Type local:ImageButton}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource ImageButtonFocusVisual}"/>
        <Setter Property="Background" Value="{StaticResource ImageButtonNormalBackground}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ImageButtonNormalBorder}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:ImageButton}">
                    <Microsoft_Windows_Themes:ButtonChrome SnapsToDevicePixels="true" x:Name="Chrome" 
                                                       Background="Transparent" 
                                                       BorderBrush="Transparent" RenderDefaulted="{TemplateBinding IsDefaulted}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}">
                        <DockPanel>
                            <DockPanel DockPanel.Dock="Top" LastChildFill="False" Margin="5,3,5,3" >
                                <Label Content="{TemplateBinding Title}" DockPanel.Dock="Left"/>
                                <Button Content="X" DockPanel.Dock="Right" x:Name="PART_CloseButton"
                                        Style="{Binding Path=CloseButtonStyle, RelativeSource={RelativeSource AncestorType={x:Type local:FabTabControl}}}"
                                        />
                            </DockPanel>
                            <Border BorderThickness="1" DockPanel.Dock="Bottom" BorderBrush="{StaticResource ImageButtonNormalBorder}">
                            <ContentPresenter 
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                Margin="0,0,0,0" 
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                                RecognizesAccessKey="True"/>
                            </Border>
                        </DockPanel>
                    </Microsoft_Windows_Themes:ButtonChrome>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="true">
                            <Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
                        </Trigger>
                        <Trigger Property="ToggleButton.IsChecked" Value="true">
                            <Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="#ADADAD"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="BorderBrush" TargetName="Chrome" Value="{StaticResource ImageButtonNormalBorder}"/>
                            <Setter Property="Background" TargetName="Chrome" Value="{StaticResource ImageButtonNormalBackground}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


</ResourceDictionary>
